package com.easygem.controller.front;

import com.easygem.common.model.system.User;
import com.easygem.common.response.ResponseMessage;
import com.easygem.common.vo.system.DepartmentVO;
import com.easygem.common.vo.system.UserVO;
import com.easygem.front.service.DepartmentService;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @author 罗力
 * @version 1.0
 * @className DepartmentController
 * @description TODO 部门控制层类
 * @date 2024/12/26 21:11
 */
@Api(tags = "部门")
@RestController
@RequestMapping("/system/departmentUtils")
public class DepartmentUtilsController {
    @Autowired
    private DepartmentService departmentService;

    @GetMapping("/getDeptByUserId")
    public ResponseMessage<List<DepartmentVO>> getDeptByUserId() {
        return ResponseMessage.success(departmentService.getDepartmentListByUser());
    }

    @PostMapping("/getUserListByMap")
    public ResponseMessage<List<UserVO>> getDeptByUserId(@RequestBody User user) {
        return ResponseMessage.success(departmentService.getUserListByMap(user));
    }
}
